package com.yaolonga.itfc.manager.linux.netplan;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: yaolong
 * @CreateTime: 2024-11-13  14:23
 * @Description: 网卡配置
 * @Version: 1.0
 */
@Data
public class NetplanEthernetConfig {
    private boolean dhcp4;
    private boolean dhcp6;
    private List<String> addresses;
    private String gateway4;
    private NetplanNameservers nameservers;
    private List<NetplanRoute> routes;

    public void addRoute(NetplanRoute route) {
        if (this.routes == null) {
            this.routes = new ArrayList<>();
        }
        this.routes.add(route);
    }

    public void addAddress(String address) {
        if (this.addresses == null) {
            this.addresses = new ArrayList<>();
        }
    }
}
